package mvc.unti;

import java.lang.reflect.Field;

import javax.servlet.http.HttpServletRequest;

public class FullBean {
	
	public FullBean(){
		
	}
	
	public Object full(HttpServletRequest request){
		Object o = null;
		try{
			String sign = request.getParameter("sign");
			Class clazz = Class.forName(sign);
			o = clazz.newInstance();
			Field[] f_ar = clazz.getDeclaredFields();
			for(Field f:f_ar){
				f.setAccessible(true);
				f.set(o, request.getParameter(f.getName()));
				f.setAccessible(false);
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		return o;
	}
}
